<!--作者:于大明-->
<template>
    <view class="product-detail-body p-1">
		
		<uni-segmented-control  class="sticky" :current="current" :values="calItems" @clickItem="current=parseInt($event.currentIndex)" styleType="button" activeColor="#007aff">
		</uni-segmented-control>
		
		<view v-show="current==0" class="bg-white px-2 pt-1">
			<text v-if="inputItem.productServiceType==10" class="text-red mb-1 font-weight">本站只负责转卖课程,具体效果因人而异,由于是虚拟资源,购买后暂不支持退款,敬请谅解</text>
			<rich-text :nodes="$util.parseHtml(inputItem.productRemark)"  @itemclick="$cw.richTextClick"></rich-text>
			<!-- 展示类似的三个类型的项目 -->
			<view class="mt-3">
				<view class="text-center font-weight font-30 ">★★★推荐项目★★★</view>
				<view class="p-2" style="border: 2px dashed rgb(227, 142, 142);">
				<product-item v-for="(item,index) in products" :key="item.id" :inputItem="item">
				</product-item>
				</view>
			</view>
		</view>
		
		<view v-show="current==1" class="text-center mt-2">
			<view class="bg-white">
				<view class="text-primary font-weight font-30">添加客服微信可免费下载一次</view>
				<image mode="aspectFit" :src="`https://pic.cwyyt.cn/upload/00whtc/addhzkf.jpg?rnd=${Math.random()}`"></image>
			</view>
		
			<view class="bg-white mt-1">
				<view class="text-primary font-weight font-30 mt-2">关注公众号,不定期更新优惠信息和领取免费下载权益</view>
				<image mode="aspectFit" :src="`https://pic.cwyyt.cn/upload/00whtc/addhzgzhnew.jpg?rnd=${Math.random()}`"></image>
			</view>
			
			<view class="bg-white mt-1">
				<view class="text-primary font-weight font-30 mt-2">加入推广可免费下载1次</view>
				<button type="primary" @tap="$cw.goTg()">加入推广</button>
			</view>
		</view>
		
		<view v-show="current==2" class="bg-white mt-2">
			<view class="d-flex font-30 text-center p-1">
				<text class="flex-shrink">下载地址:</text>
				<view v-if="inputItem.productLinkUrl">
					<a :href="inputItem.productLinkUrl">
						{{inputItem.productLinkUrl}}
					</a>
					<button  type="primary" size="mini"
						class="position-relative ml-2" style="top:10rpx"
						@tap="$util.copyText(inputItem.productLinkUrl)">复制地址</button>
				</view>
				<view v-else class="text-primary ml-1">
					购买后显示
				</view>
			</view>
		</view>
		
		<view v-show="current==3">
			<view class="bg-white j-sb  p-2 mt-2" v-for="(item,index) in vipPrices" :key="index">
				<view class="d-flex">
					<text class="font-weight flex-1">{{item.text}}</text>
					<button size="mini" type="primary" @tap="$emit('openVip',item)" >开通</button>
				</view>
				
				<view class="d-flex mt-1">
					<view class="flex-1">
						<text class="text-prompt">有效期:</text>
						<text class="text-blue">{{item.days}}天</text>
					</view> 
					<view class="text-orange font-weight" style="margin-left: 6rpx;">
						<text class="font-22">¥</text>
						<text class="font-30">{{item.price.toFixed(2)}}</text>
					</view>
				</view>
				
				<view class="text-prompt text-warp">
					{{item.desc}}
				</view>
			</view>
		</view>
		
	</view>
</template>

<script src="./product-detail-body.js"></script>

<style lang="less" scoped>
    @import url('product-detail-body.less');
</style>
